<%@page import="com.project.util.StringUtil"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String loginState = (String) request.getAttribute(StringUtil.LOGINSTATE);
	String result = (String) request.getAttribute(StringUtil.RESULT);
	//访问cookie 查看是否记住了密码
%>
<%@ include file="/WEB-INF/jsp/include/head.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
	$(function() {
		var $submit = $("#submit");
		$submit.click(function(){
			var $login_form = $("#loginForm");
			var id = $("#id").val().trim();
			var password = $("#password").val().trim();
			//判断用户名、密码是否为空
			if(id == null || id == ""){
				alert("用户id不能为空!"); 
				return;
			}
			if(password == null || password == ""){
				alert("请填写密码!"); 
				return;
			}
			$login_form.submit();
		});
		
	});
</script>
<title>登录</title>
</head>
<body>
<div class="container" >
	<%@ include file="/WEB-INF/jsp/include/top.jsp"%>
	<br>
	<div class="margin_top col-lg-6 col-md-6 col-md-push-3 col-xs-12 col-sm-12">
	<form action="user/login" method="post" id="loginForm">
		<table class="table">
			<tr>
				<th>用户名：</th>
				<td><input name="id" id="id" placeholder="用户名"></td>
			</tr>
			<tr>
				<th>密码：</th>
				<td><input type="password" name="password" id="password"
					placeholder="密码"></td>
			</tr>
			<tr>
				<td><label> <input type="checkbox" id="isRememberId"
						name="isRememberId" value="true" <%%>>记住用户名
				</label></td>
				<td><label> <a href="user/findPasswordJSP">忘记密码</a>
				</label></td>
			</tr>
		</table>
	</form>
	<button id="submit" class="btn submit">登录</button>
	<%
		if (result != null && result.equals(StringUtil.E_LOGIN)) {
	%>
	用户名或密码错误
	<%
		}
	%>
	</div>
	<%@ include file="/WEB-INF/jsp/include/bottom.jsp"%>
</div>
</body>
</html>
